import os

from flask_cors import CORS

from datetime import timedelta

from toutiao import app

#设置 BASE_DIR
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#定义配置类
class Config(object):

    DEBUG = True
    # 配置类中 key 要大写!!!
    #SQLAlchemy 的 mysql 的配置
    SQLALCHEMY_DATABASE_URI = 'mysql://root:root@127.0.0.1:3306/black_horse_news'
    SQLALCHEMY_TRACK_MODIFICATIONS = False



    # Redis的配置
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    REDIS_DB = 0



    # JWT的配置信息
    JWT_SECRET = 'yoursecretkey'
    JWT_EXPIRY_HOURS= 2
    JWT_REFRESH_DAYS= 14



